import Vue from "vue";
import VueRouter from "vue-router";
import Home from "../views/Home.vue";
import Order from '../components/first/Order.vue'
import My from '../components/first/My.vue'
import Index from '../views/Index' 
import City from '../components/city/City.vue'
Vue.use(VueRouter);

const routes = [
  {
    path: "/",
    redirect: '/home'
  },
  {
    path:'/city',
    name:'city',
    component:City,
  },
  {
    path: "/home",
    name: "home",
    component: Home,
    redirect: '/home/index',
    children: [
      {
        path: 'index',
        name: "index",
        component: Index,
      },
      {
        path: 'order',
        name: "order",
        component: Order,
      },

      {
        path: 'my',
        name: "my",
        component: My,
      }
    ]
  },

];

const router = new VueRouter({
  routes,
  mode: 'history'
});

export default router;
